<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" import="java.util.*,org.edu.model.*"%>
<%@ include file="common/base.jsp"%>
<%
	User user=(User)session.getAttribute("user");
	if(null!=user)
		response.sendRedirect(request.getSession().getServletContext().getContextPath()+"/Interface/hello.jsp");
%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>

<meta http-equiv="X-UA-Compatible" content="IE=10" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>login</title>
<link href="${path }/dist/css/bootstrap.min.css" rel="stylesheet" />
<link href="${path }/dist/css/Buttom.css" rel="stylesheet" />
<link href="${path }/dist/css/flat-ui.css" rel="stylesheet">
<link href="${path }/dist/css/demo.css" rel="stylesheet">
<%-- 属flat-ui--%>
<%--<link href="${path }/dist/css/bootstrap2/bootstrap-switch.css" rel="stylesheet">--%>



</head>
<body>
	<div class="container">
		<div class="login">
			<div class="login-screen">
				<div class="login-icon">
					<img src="${path }/dist/img/png/icon.png" alt=".." />
					<h4>
						欢迎使用 <small>XX管理软件</small>
					</h4>
				</div>

				<div class="login-form">
					<form class="form-horizontal" role="form" method="post"
						action="${path }/login" id="login">
						<div class="form-group">
							<input type="text" class="form-control login-field"
								name="user.account" value="" placeholder="Enter your name"
								id="login-name" /> <label class="login-field-icon fui-user"
								for="login-name"></label>
						</div>

						<div class="form-group">
							<input type="password" class="form-control login-field"
								name="user.pass" value="" placeholder="Password" id="login-pass" />
							<label class="login-field-icon fui-lock" for="login-pass"></label>
						</div>
						<div class="form-group">
							<label class="checkbox" for="checkbox2" style="color: #3498db;"> <input
								type="checkbox" value="true" id="checkbox2" 
								data-toggle="checkbox" name="isadmin"/> 管理员登录
							</label>
							
						</div>
					</form>
					<button type="button" class="btn btn-info btn-block"
						onclick="loginManagement()">Log in</button>
					<a href="#" class="login-link" data-toggle="modal"
						data-target="#retrieve">Lost your password?</a>

				</div>
			</div>
		</div>

	</div>


	<div class="modal fade" tabindex="-1" role="dialog"
		aria-labelledby="mySmallModalLabel" aria-hidden="true" id="retrieve">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="retrievepass">找回密码</h4>
				</div>

				<div class="modal-body">
					<div class="container">
						<div class="col-lg-6">
							<div class="input-group">

								<input type="text" class="form-control" placeholder="请输入邮箱" />
								<span class="input-group-addon">@</span>
							</div>
							<p class="help-block">请输入需要找回的帐号,我们将找回密码的链接发送到您的注册邮箱</p>
							<!-- /input-group -->
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
						<button type="button" class="btn btn-primary">cofig</button>
					</div>
				</div>
			</div>
		</div>
	</div>
	<%@include file="Footer.jsp"%>
	<c:if test="${tip != null }">
		<script>
			alert('${tip}');
		</script>
	</c:if>



	<script src="${path }/dist/js/jquery.min.js"></script>
	<script src="${path }/dist/js/bootstrap.min.js"></script>
	<!--  script src="${path }/dist/js/bootstrap-switch.js"></script>-->
	<script type="text/javascript">
	<!--
	$(function(){
		
		if(window.parent.location.href!=window.location.href){
			top.location.href=window.location.href;
		}
	});
		//$("#create-switch").parent().bootstrapSwitch();
		function loginManagement() {
			if($("#login-name").val()==""||$("#login-name").val().length<=0){
				alert("用户名不可为空");
				$("#login-name").focus();
				return;
			}else if($("#login-pass").val()==""||$("#login-pass").val().length<=0){
				alert("密码不可为空");
				$("#login-pass").focus();
				return;
			}
			var t=$('#login').serialize();
			//alert(t);
			$.ajax({
				async : false,
				cache : false,
				type : 'POST',
				dataType : "html",
				url : '${path}/sgin/login?' + t,
				success : function(data) {
					if (data == "succes") {
						window.location.href = "${path}/admin";
					}
					if(data == "error")
						alert("帐号或密码错误");
				},
				error : function() {
					//失败
					alert("获取登录状态失败");
				}
			});
		}
	//-->
	</script>
</body>
</html>